package com.bigShen.spring.mybatis;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;

/**
 * @Author eddy.shen
 * @Date 2018/12/22 12:00
 **/
public class SpringMyBatisDesc {

    public static void main(String[] args) {
        //
        /**
         * spring bean 挂载点
         *
         * 1. xml配置
         * MapperScannerConfigurer.postProcessBeanFactory() 扫描
         * {@link MapperScannerConfigurer#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)}
         *
         * 2. java config 方式
         * MapperScannerRegistrar.registerBeanDefinitions() 扫描
         * {@link ImportBeanDefinitionRegistrar#registerBeanDefinitions(org.springframework.core.type.AnnotationMetadata, org.springframework.beans.factory.support.BeanDefinitionRegistry)
         *
         * ImportBeanDefinitionRegistrar Interface to be implemented by types that register additional bean definitions when
         *  processing @{@link Configuration} classes;
         *
         * 3. Spring MyBais 的 SqlSession
         *   在没有@Transaction情况下, 是 request/method级别的;
         *   在有@Transaction情况下, 是 Transaction级别的
         *
         *
         *
         */

        MapperScannerConfigurer configurer = null;


        /**
         *
         * mybatis-spring-1.3.2-sources.jar!/org/mybatis/spring/mapper/ClassPathMapperScanner.java:187
         *      definition.setBeanClass(this.mapperFactoryBean.getClass())
         */

    }

}
